// formPackage/pages/myHouseEnter/myHouseEnter.js
let app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    themeStyle: "",
    enterList: [
      // {
      //   name: "新房",
      //   icon: "https://saas.img.ylyc.top/iconpublishnewicon_icon.png",
      //   path: "/newHousePackage/pages/housePublishList/housePublishList"
      // },
      {
        name: "二手房",
        icon: "https://saas.img.ylyc.top/iconpublishsecondicon_icon.png",
        path: "/secondHousePackage/pages/mySecondHouseList/mySecondHouseList"
      },
      {
        name: "商铺",
        icon: "https://saas.img.ylyc.top/iconpublishshopicon_icon.png",
        path: "/secondHousePackage/pages/shopModule/myShopList/myShopList"
      },
      {
        name: "租房",
        icon: "https://saas.img.ylyc.top/iconpublishrenticon_icon.png",
        path: "/secondHousePackage/pages/rentHouseModule/myRentList/myRentList"
      }
    ],
    isBindMp: false,
    showMp: false,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      isBindMp: app.globalData.isBindMp,
    })
  },


  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    if (app.globalData.themeStyle) {
      this.setData({
        themeStyle: app.globalData.themeStyle
      })
    }
  },
  pushToPublish(e) {
    if (!this.data.isBindMp) {
      //未关注公众号:
      this.setData({
        showMp: true
      })
      return;
    }
    let path = e.currentTarget.dataset.path;
    wx.navigateTo({
      url: path,
    })
  },

  clickCenterPopupOverlay() {
    this.setData({
      showMp: false,
      isBindMp: true,
    })
  },
  //跳转到公众号页面:
  pushToMpPage() {
    this.setData({
      showMp: false,
    })
    wx.navigateTo({
      url: '/firstPackage/pages/officialAccounts/officialAccounts',
    })
  },


})